import {
  getAction,
  deleteAction,
  putAction,
  postAction
} from '@/api/manage'

const modelList = (param) => postAction("/act/model/list", param)

const addModel = (param) => postAction("/act/model/add", param)

const editModel = (param) => putAction("/act/model/edit", param) //todo

const deleteModel = (param) => deleteAction("/act/model/delete", param)

const getModelSource = (param) => getAction("/act/model/source/" + param)

const deployModel = (param) => postAction("/act/model/deploy/" + param)

const deployModelSource = (param) => postAction("/act/model/deploySource", param)

const getDeployedList = (param) => getAction("/act/model/deployed/list", param)

const allDeployedModel = (param) => getAction("/act/model/deployed/all", param)

const getTaskOpinions = (param1,param2) => getAction("/act/task/opinionsByProcessId/" + param1 + "/" + param2)

const getLoadBackButton = (param1,param2) => getAction("/act/task/getLoadBackButton/" + param1 + "/" + param2)

const getProcessDetails = (param) => getAction("/act/task/processDetails/" + param)

const completeTask = (param) => postAction("/act/task/complete", param)

const isNotGateway = (param) => postAction("/act/task/isNotGateway", param)

const deleteTask = (param) => deleteAction("/act/task/delete", param)


const allDefinitionList = (param) => getAction("/act/process/definition/all", param)

const addProcess = (param) => postAction("/act/process/add", param)

const editProcess = (param) => putAction("/act/process/edit", param)

const deleteProcess = (param) => deleteAction("/act/process/delete", param)

const getProcess = (param) => getAction("/act/process/source/" + param)

// const updateProcessStatus = (id, flag) => putAction("/act/process/updateStatus/" + id + '/' + flag)

const backTask = (param) => postAction("/act/task/back", param)
const updateProcessStatus = (id) => putAction("/act/process/updateStatus/" + id)


//添加和修改任务基本信息
const addTaskInfo = (param) => postAction("/act/process/addTaskInfo", param)
const editTaskInfo = (param) => putAction("/act/process/edit", param)
//复制模板
const copyTemplate = (param) => postAction("/act/model/copyTemplate", param)

//流程规划
const flowPlan = (param) => postAction("/act/process/flowPlan", param)

//流程启动
const taskStart = (param) => postAction("/act/process/taskStart", param)

//查看流程过程图片
const getProcImage = (param) => getAction("/act/task/getShineProcImage/" + param)

//获取上传文件格式
const loadTaskFileType = (param1,param2) => getAction("/act/task/loadTaskFileType/" + param1 + "/" + param2)
//获取上传文件路径
const getLoadTaskFiles= (param1,param2) =>getAction("/act/task/getLoadTaskFiles/" + param1 + "/" + param2)

//获取节点描述
const loadDescription = (param) => getAction("/act/task/loadDescription/" + param)
//获取当前位置人员
const loadUser = (param) => getAction("/act/task/loadUser/" + param)
//获取开始时间
const loadStart = (param) => getAction("/act/task/loadStart/" + param)
//获取结束时间
const loadEnd = (param) => getAction("/act/task/loadEnd/" + param)
//获取执行天数
const loadDateDiff = (param) => getAction("/act/task/loadDateDiff/" + param)
//获取当前位置名称
const loadName = (param) => getAction("/act/task/loadName/" + param)
//获取上一节点位置执行人
const getPreUser= (param) =>getAction("/act/task/getPreUser/" + param)
//获取我自己是谁
const getMyUser= (param) =>getAction("/act/task/getMyUser/" + param)
//获取时间状态
const loadTimeStatus= (param) =>getAction("/act/task/loadTimeStatus/" + param)

//获取全部信息
const getFileTypes = (param) => getAction("/act/task/getFileTypes/" + param)

//获取待办任务列表信息
const getTodoTaskList=(param) =>getAction("/act/task/mine/",param)

const getFlowDetails = (param) => getAction("/act/task/getFlowDetails/" + param)

export {
  modelList,
  addModel,
  editModel,
  deleteModel,
  getModelSource,
  deployModel,
  deployModelSource,
  getDeployedList,
  allDeployedModel,

  getTaskOpinions,
  getProcessDetails,
  completeTask,
  deleteTask,

  allDefinitionList,
  addProcess,
  editProcess,
  deleteProcess,
  getProcess,
  updateProcessStatus,
  addTaskInfo,
  editTaskInfo,
  copyTemplate,
  flowPlan,
  taskStart,
  backTask,
  getProcImage,
  loadTaskFileType,
  loadDescription,
  loadUser,
  loadStart,
  loadEnd,
  getLoadTaskFiles,
  getTodoTaskList,
  isNotGateway,
  loadDateDiff,
  loadName,
  getPreUser,
  getMyUser,
  loadTimeStatus,
  getFileTypes,
  getLoadBackButton,
  getFlowDetails

}